﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web;
using VirtualPress.Infrastructure.Entities.Entity;

namespace VirtualPress.Portal.WebLogic.BaseController
{
    //public class ConsoleBaseController : Controller
    //{
    //    protected override void OnActionExecuting(ActionExecutingContext filterContext)
    //    {
    //        ViewBag.ControllerName = "Console";
    //        if (HttpContext.Request.HttpMethod.ToLower() == "get")
    //        {
    //            string journal = Request.QueryString["journal"];
    //            Journal entity = null;
    //            if (!String.IsNullOrEmpty(journal) && journal != "-1")
    //            {
    //                entity = new Journal().Find(journal);
    //            }
    //            else
    //            {
    //                entity = new Journal().Find(c => c.Admin == HttpContext.User.Identity.Name);
    //            }
    //            if (entity == null)
    //            {
    //                HttpContext.Response.Redirect("/workspace/home/index");
    //            }
    //            ViewBag.Journal = entity;

    //            var newCount = new Article().Count(
    //                c => c.Peri_Id == entity.Id && !c.IsDelete && c.Status == 0);

    //            var waitCount = new Article().Count(
    //                c => c.Peri_Id == entity.Id && !c.IsDelete && new List<int>() { 2, 4, 6, 8, 10 }.Contains(c.Status));
                
    //            ViewBag.NewArticleCount = newCount;
    //            ViewBag.WaitArticleCount = waitCount;
    //        }
    //    }
    //}
}
